package com.demo.camunda.service.impl;


import com.demo.camunda.dao.MsgDao;
import com.demo.camunda.dao.SqmWarningBaseDao;
import com.demo.camunda.dao.SqmWarningMappingDao;
import com.demo.camunda.entity.Msgclient;
import com.demo.camunda.entity.SqmWarningBase;
import com.demo.camunda.service.uploadExcel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Executor;

@Slf4j
@Service
public class uploadExcelImpl  {

    @Autowired
   private SqmWarningBaseDao baseDaoMapper;


    @Autowired
    private SqmWarningMappingDao sqmWarningMappingDao;

    @Autowired
    private Executor myExecutor;


    @Async(value="myExecutor")
    public void insertList(List<SqmWarningBase> list){
        log.info("{}条数据，第1个sheet开始存储数据库!", list.size());

        log.info(Thread.currentThread().getName());

        if(CollectionUtils.isNotEmpty(list)){
            baseDaoMapper.insertBaseList(list);
        }
        log.info("第1个sheet存储数据库成功!");
    }


    public void getfieldFromMapping(){

    }


}
